package mop.exception;

import java.sql.Timestamp;

/**
 * Exception class for incorrect reservations
 * ergo start > than end
 * 
 * @invar none this is a exception
 * 
 * @author	 MOP Team 7
 */
public class IllegalReservationException extends Throwable 
{

	/**
	 * Initializes an IllegalReservationException with the passed timestamps
	 * 
	 * @param start
	 *  the start time thats incorrect
	 *  
	 * @param end
	 *  the end time that's incorrect
	 *  
	 * @post this.start = start
	 *       this.end = end
	 */
	public IllegalReservationException(Timestamp start,Timestamp end)
	{
		this.start = start;
		this.end = end;
	}
	
	/**
	 * return a error message that can be used by the gui
	 * 
	 * @return an error message describing the incorrect name
	 */
	public String toString()
	{
		
		StringBuffer sb = new StringBuffer();
		sb.append("The following couple of time is not a valid one ! ");
		sb.append("start = "+this.start);
		sb.append(" end = "+this.end);
		return sb.toString();
	}
	
	 
	/**
	 * weird java demand
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * the Timestamps that are trouble
	 */
	private Timestamp start;
	private Timestamp end;
	
}
